From 4a8302220710688f434db6947b7d87108ff1a349 Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Wed, 30 Aug 2006 18:02:32 +0100 Subject: [PATCH] [XEN] physdev: Check for negative irqs in alloc_irq_vector. Signed-off-by: Herbert Xu --- xen/arch/x86/physdev.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/physdev.c b/xen/arch/x86/physdev.c index caf6f393e4..2d4841a039 100644 --- a/xen/arch/x86/physdev.c +++ b/xen/arch/x86/physdev.c @@ -96,10 +96,11 @@ long do_physdev_op(int cmd, XEN_GUEST_HANDLE(void) arg) if ( !IS_PRIV(current->domain) ) break; + irq = irq_op.irq; ret = -EINVAL; - if ( (irq = irq_op.irq) >= NR_IRQS ) + if ( (irq < 0) || (irq >= NR_IRQS) ) break; - + irq_op.vector = assign_irq_vector(irq); ret = copy_to_guest(arg, &irq_op, 1) ? -EFAULT : 0; break; -- 2.30.2